package com.wc.AlgoOJ_homework.AlOJ模块测试I.I_蜗牛;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/5/12 12:42
 * @description http://43.138.190.70:8888/p/1120?tid=663e1b10d39d10926ed3f7fa
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 100010;
    static int[] x = new int[N];
    static int[] a = new int[N];
    static int[] b = new int[N];
    // f[i][j] 表示到达i根竹竿, j = 0表示在0的位置, j = 1表示在a[i]的位置上
    static double[][] f = new double[N][2];
    static double INF = 1e20;
    static int n;

    public static void main(String[] args) {
        n = sc.nextInt();
        for (int i = 1; i <= n; i++) x[i] = sc.nextInt();
        for (int i = 1; i < n; i++) {
            a[i] = sc.nextInt();
            b[i + 1] = sc.nextInt();
        }
        for (int i = 0; i <= n; i++) Arrays.fill(f[i], INF);
        f[1][0] = x[1];
        f[1][1] = x[1] + a[1] / 0.7;
        for (int i = 2; i <= n; i++) {
            // 要么从左边过来，要么从上面下来
            f[i][0] = Math.min(f[i - 1][0] + x[i] - x[i - 1], f[i - 1][1] + b[i] / 1.3);
            // 从左边顺义后爬到a[i], 要么从下面上来到a[i]
            f[i][1] = Math.min(f[i - 1][1] + Math.abs(b[i] - a[i]) / (b[i] > a[i] ? 1.3 : 0.7),
                    f[i][0] + a[i] / 0.7);
        }
        out.printf("%.2f\n", f[n][0]);
        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
